<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css优先级</title>
    <style>
  div {
      color: red;
  }
  .test {
      color: pink!important
  }
  #demo {
      color: blue;
  }
    </style>
</head>

<body>
    <!-- <div class="test" id="demo" style="color: yellow;">
        你猜我是什么颜色
    </div> -->
    <table border="1" cellpadding="0" cellspacing="0" width="600px" height="300px">
        <tr>
            <th>选择器</th>
            <th>选择器权重</th>
        </tr>
        <tr>
            <td>继承或者*（通配符选择器）</td>
            <td>0,0,0,0</td>
        </tr>
        <tr>
            <td>元素选择器</td>
            <td>0,0,0,1</td>
        </tr>
        <tr>
            <td>类选择器，伪类选择器</td>
            <td>0,0,1,0</td>
        </tr>
        <tr>
            <td>id选择器</td>
            <td>0,1,0,0</td>
        </tr>
        <tr>
            <td>行内样式style=""</td>
            <td>1,0,0,0</td>
        </tr>
        <tr>
            <td>!important重要的</td>
            <td>≈无穷大</td>
        </tr>
    </table>
</body>

</html>